using System.Collections.Generic;

public class Table_EffectItem
{
    /// <summary>
    /// 唯一ID
    /// <summary>
    public int Id { get; private set; }
    /// <summary>
    /// Prefab路径或ModelID
    /// <summary>
    public string Path { get; private set; }
    /// <summary>
    /// 特效延迟时间
    /// <summary>
    public float DelayTime { get; private set; }
    /// <summary>
    /// 是否播放完只失效(0销毁，1不销毁只失效）
    /// <summary>
    public bool IsOnlyDeactive { get; private set; }
    /// <summary>
    /// 位置坐标
    /// <summary>
    public string Pos { get; private set; }
    /// <summary>
    /// 旋转坐标
    /// <summary>
    public string Rota { get; private set; }
    /// <summary>
    /// 持续时间 0代表循环
    /// <summary>
    public float Duration { get; private set; }

    public Table_EffectItem(ExcelLineReader reader)
    {
        Id = reader.ReadInt();
        Path = reader.ReadString();
        DelayTime = reader.ReadFloat();
        IsOnlyDeactive = reader.ReadBool();
        Pos = reader.ReadString();
        Rota = reader.ReadString();
        Duration = reader.ReadFloat();
    }
}

public class Table_EffectMgr : IDataMgr
{
    protected override string FileName { get { return "Txt/Effect.txt"; } }

    protected List<Table_EffectItem> mItemList = new List<Table_EffectItem>();
    public Table_EffectItem GetItemByIdx(int idx)
    {
        return mItemList[idx];
    }
    public Table_EffectItem GetItemById(int id)
    {
        int idx = GetIdxById(id);
        return GetItemByIdx(idx);
    }

    public override void Load(ExcelLineReader reader)
    {
        var item = new Table_EffectItem(reader);
        mItemDic.Add(item.Id, mDataCount);
        mItemList.Add(item);
    }
}